<?php

// 处理登录 process login operation
if(!empty($_POST['username']) && !empty($_POST['password'])) {
	$userData = $db->rows('SELECT * FROM admin_users where username="'.$_POST['username'].'" and password="'.md5($_POST['password']).'" limit 1');
	if($userData){
		$_SESSION['sys'] = $userData;
		header("location: ?model=admin&action=index");
	}
}
if($_GET['todo'] =='logout') {
	$_SESSION['sys'] = array();
	header('location: ?model=admin&action=index');
}
Basic :: setModelFile('login');
$tpl->p();
?>